package com.local.admin.service.impl;

import com.local.admin.service.CarouselService;
import com.local.carousel.feign.CarouselServiceFeign;
import com.local.carousel.pojo.Carousel;
import com.local.carousel.pojo.CarouselDeleteRequestParam;
import com.local.carousel.pojo.CarouselListRequestParam;
import com.local.common.util.PageResultUtil;
import com.local.common.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CarouselServiceImpl implements CarouselService {

    @Autowired
    private CarouselServiceFeign carouselServiceFeign;

    @Override
    public ResultUtil<PageResultUtil<Carousel>> list(CarouselListRequestParam requestParam) {
        ResultUtil<PageResultUtil<Carousel>> list = carouselServiceFeign.list(requestParam);
        return list;
    }

    @Override
    public ResultUtil getById(Integer id) {
        ResultUtil carouselResult = carouselServiceFeign.info(id);
        return carouselResult;
    }

    @Override
    public ResultUtil save(Carousel carousel) {
        ResultUtil saveResult = carouselServiceFeign.save(carousel);
        return saveResult;
    }

    @Override
    public ResultUtil update(Carousel carousel) {
        ResultUtil updateResult = carouselServiceFeign.update(carousel);
        return updateResult;
    }

    @Override
    public ResultUtil delete(CarouselDeleteRequestParam deleteRequestParam) {
        ResultUtil deleteResult = carouselServiceFeign.delete(deleteRequestParam);
        return deleteResult;
    }
}
